package cn.hl.hm.service.impl;


import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.hl.hm.dao.TBackstageOperationRecordEntityMapper;
import cn.hl.hm.entity.backstage.TBackstageOperationRecordEntity;
import cn.hl.hm.service.BackstageOperationRecordService;
import cn.hl.hm.util.Tools;


/**
 * dcr
 */
@Component
public class BackstageOperationRecordServiceImpl implements BackstageOperationRecordService {
    private static final Logger logger = LoggerFactory
            .getLogger(BackstageOperationRecordServiceImpl.class);
    @Autowired
    TBackstageOperationRecordEntityMapper tBackstageOperationRecordEntityMapper;
	@Override
	public int insertSelective(Integer userId,String phone,String operationContent) {
		logger.info("进入操作记录表传递参数：userID"+userId);
		int i=0;
		if(null==userId || "null".equals(userId)){
			return i;
		}
		if(0==userId){
			return i;
		}
		TBackstageOperationRecordEntity tbore=new TBackstageOperationRecordEntity();
		tbore.setUserId(userId);
		tbore.setCreateTime(new Date());
		if(Tools.isNotBank(phone)){
			tbore.setPhone(phone);
		}
		if(Tools.isNotBank(operationContent)){
			tbore.setOperationContent(operationContent);
		}
		try{
		i=tBackstageOperationRecordEntityMapper.insertSelective(tbore);
		}catch(Exception e){
			e.printStackTrace();
			logger.info(e+"");
		}
		return i;
	}
   
}
